Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement CE Subscriptions filters #5715

Merged
merged 8 commits into from
Nov 11, 2021

Conversation

devguyio
Copy link
Contributor

@devguyio devguyio commented Sep 7, 2021

Part of #5204
Rewrite of #5205 by @slinkydeveloper .

Proposed Changes

  • 🎁 Add CE Subscriptions API filters field to Trigger objects.

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature
  • Conformance test for any change to the spec

Release Note

Triggers now include a CloudEvents Subscriptions API compatible filters field as an experimental feature.

Docs

Docs will be added with the implementation in mt-broker.

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 7, 2021
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Sep 7, 2021
@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. area/test-and-release Test infrastructure, tests or release approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 7, 2021
@devguyio devguyio changed the title [WIP] Implement CE Subscriptions filters Implement CE Subscriptions filters Sep 8, 2021
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 8, 2021
@devguyio
Copy link
Contributor Author

devguyio commented Sep 8, 2021

This is ready for review, but I'm holding to figure out how should this be merged wrt the experimental feature in #5204 . I'm also still not clear on docs, spec and rest of the check boxes in the description.
/hold

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 8, 2021
@codecov
Copy link

codecov bot commented Sep 8, 2021

Codecov Report

Merging #5715 (5363c2b) into main (31e4e2e) will increase coverage by 0.05%.
The diff coverage is 82.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5715      +/-   ##
==========================================
+ Coverage   81.99%   82.05%   +0.05%     
==========================================
  Files         220      220              
  Lines        7458     7527      +69     
==========================================
+ Hits         6115     6176      +61     
- Misses        916      917       +1     
- Partials      427      434       +7     
Impacted Files Coverage Δ
pkg/apis/eventing/v1/trigger_types.go 100.00% <ø> (ø)
pkg/apis/eventing/v1/trigger_validation.go 85.61% <82.71%> (-6.17%) ⬇️
pkg/scheduler/statefulset/scheduler.go 78.59% <0.00%> (+0.63%) ⬆️
pkg/reconciler/subscription/subscription.go 80.23% <0.00%> (+1.01%) ⬆️
pkg/channel/message_dispatcher.go 81.25% <0.00%> (+1.56%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 31e4e2e...5363c2b. Read the comment docs.

@antoineco
Copy link
Contributor

If this is only adding API fields (and their validation) but the data plane implementation doesn't exist yet, is it really wise to add release notes already?

I'm also curious whether there is already a formal plan for implementing the "dialects" (part 2 of the feature).

Copy link
Contributor

@odacremolbap odacremolbap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see this taking shape.
Did some early comments on it.

config/core/resources/trigger.yaml Outdated Show resolved Hide resolved
config/core/resources/trigger.yaml Outdated Show resolved Hide resolved
config/core/resources/trigger.yaml Outdated Show resolved Hide resolved
pkg/apis/eventing/v1/trigger_types.go Outdated Show resolved Hide resolved
pkg/apis/eventing/v1/trigger_validation.go Outdated Show resolved Hide resolved
docs/eventing-api.md Outdated Show resolved Hide resolved
@devguyio
Copy link
Contributor Author

devguyio commented Sep 8, 2021

If this is only adding API fields (and their validation) but the data plane implementation doesn't exist yet, is it really wise to add release notes already?

It was one of the questions I wanted to discuss, cause I also think it probably should only be added once the full experimental feature gets merged.

I'm also curious whether there is already a formal plan for implementing the "dialects" (part 2 of the feature).

Yes, in this section in the feature track which is also linked in the overarching issue #5204

Copy link
Contributor

@antoineco antoineco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks solid, I like what this API will enable 👍
I haven't looked at the tests yet, so just focusing on generic stuff and typos spotted in the doc so far.

config/core/resources/trigger.yaml Outdated Show resolved Hide resolved
config/core/resources/trigger.yaml Outdated Show resolved Hide resolved
docs/eventing-api.md Outdated Show resolved Hide resolved
docs/eventing-api.md Outdated Show resolved Hide resolved
docs/eventing-api.md Outdated Show resolved Hide resolved
pkg/apis/eventing/v1/trigger_types.go Outdated Show resolved Hide resolved
pkg/apis/eventing/v1/trigger_types.go Outdated Show resolved Hide resolved
pkg/apis/eventing/v1/trigger_validation.go Outdated Show resolved Hide resolved
pkg/apis/eventing/v1/trigger_validation.go Outdated Show resolved Hide resolved
pkg/apis/eventing/v1/trigger_validation.go Outdated Show resolved Hide resolved
Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is intended to be an experimental feature I think we should follow for consistency a similar pattern of #5149:

  • The new field is not added to the OpenAPI schema
  • The feature is disabled by default and uses a feature flag to enable it

@devguyio devguyio changed the title Implement CE Subscriptions filters [WIP] Implement CE Subscriptions filters Sep 9, 2021
@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 9, 2021
@devguyio
Copy link
Contributor Author

devguyio commented Sep 9, 2021

If this is intended to be an experimental feature I think we should follow for consistency a similar pattern of #5149:

  • The new field is not added to the OpenAPI schema

@pierDipi I wasn't aware of the OpenAPI schema requirement, you are right! It was documented in our experimental feature doc 😅 .

  • The feature is disabled by default and uses a feature flag to enable it

Yeah definitely, it's why I've a hold on this cause I'm still discovering the mechanics of how everything will land together but needed a feedback on the API shape. Cool!

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
@devguyio devguyio changed the title [WIP] Implement CE Subscriptions filters Implement CE Subscriptions filters Nov 10, 2021
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 10, 2021
@devguyio
Copy link
Contributor Author

Updates:

  • Applied review comments
  • Added a feature flag

/unhold

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 10, 2021
Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
@pierDipi pierDipi self-requested a review November 11, 2021 07:28
pkg/apis/eventing/struct_validation.go Outdated Show resolved Hide resolved
pkg/apis/eventing/struct_validation.go Outdated Show resolved Hide resolved
pkg/apis/eventing/struct_validation.go Outdated Show resolved Hide resolved
pkg/apis/eventing/v1/trigger_validation.go Outdated Show resolved Hide resolved
Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
@devguyio
Copy link
Contributor Author

devguyio commented Nov 11, 2021

@pierDipi @antoineco changed. Thanks for the review.

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/eventing/v1/trigger_validation.go 98.3% 94.1% -4.2

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 11, 2021
Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this awesome feature!

/lgtm
/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: antoineco, devguyio, pierDipi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [antoineco,devguyio,pierDipi]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test-and-release Test infrastructure, tests or release cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants